Autoloader.constructor   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
c 0
b 0
f 0
dl 0
loc 3
rs 10
1
import { ModuleManager } from './module-manager'
2
import { MenuManager } from './menu-manager'
3
4
class Autoloader {
5
    constructor() {
6
        this.lazyLoad()
7
    }
8
9
    lazyLoad() {
10
        let page = $('meta[name="page"]').attr('content')
11
12
        switch (page) {
13
            case 'module-manager':
14
                new ModuleManager()
15
                break;
16
17
            case 'menu-manager':
18
                new MenuManager()
19
                break;
20
        }
21
    }
22
}
23
24
new Autoloader()
0 ignored issues
show
Unused Code Best Practice introduced by
The object created with new Autoloader() is not used but discarded. Consider invoking another function instead of a constructor if you are doing this purely for side effects.
Loading history...